A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent disclosure, as it appears in the Patent and Trademark Office patent files or records, but otherwise reserves all copyright rights whatsoever.
This invention relates generally to computer systems, and particularly, but not by way of limitation, to a global file system and data storage device locks for managing shared data storage on a networked computer system.
Modern computer systems are often linked by a network. The network couples several computer processing clients for communication using a standard communication protocol, such as Transmission Control Protocol/Internet Protocol (TCP/IP). Data stored locally at the clients is shared with other clients by sending messages across the network. Alternatively, data is stored in data storage devices that are shared by multiple clients, rather than being stored locally by the clients. Both the shared storage device and an intermediary server are coupled to the network. The server controls client access to the shared storage device. The clients send requests for data to the server. The server accesses the shared storage device and provides the requested data to the client.
Since communication across a network is typically relatively slow, data caching is often desirable to minimize communication across the network. Rather than returning the data from the client to the shared storage device after client processing, and again retrieving the data from the shared storage device for further client processing, a duplicate copy of the data is transferred from the shared storage device to the client. The copy of the data is stored locally in a memory cache in the client, where it is accessed directly. Such direct access of cached data is much faster than retrieving the data from the shared storage device over the network.
The client may perform multiple read operations on the cached data, rather than repeatedly requesting such data be delivered over the network from the shared storage device. The client may also perform operations that alter the cached data. As a result of any such alterations, the client""s cached data will be different than the original data in the shared memory device. In this case, the client must eventually write back the altered cached data to the shared storage device after it completes its processing. The altered data is transferred back over the network to the shared storage device. The obsolete original data is overwritten with the altered data.
Thus, caching requires copies of data in more than one location, such as at the shared storage device and at the client. This minimizes the time spent transferring data across the network. Caching also allows data to be prefetched from the shared storage device concurrently with other client operations. Prefetching allows the data to be already resident in the client""s memory cache when needed by the client. Caching ultimately requires eventual consistency between the data in client memory cache and the shared storage device.
Sharing a storage device among several clients further complicates the task of maintaining data consistency between the client memory caches and the shared storage device. In a traditional client-server system, the task of maintaining data consistency is typically performed by a centralized server. Servers are categorized as either stateless or stateful. A stateless server maintains no information regarding a client""s previous requests to access data from the shared storage device. Stateless severs rely on their clients to maintain data consistency. The clients maintain data consistency by brute force techniques, such as by using write-through caching and periodically invalidating their local memory caches. A stateful server maintains information about previous client requests to access data from the shared storage device. This state information, which is typically stored in volatile memory in the server, allows the server to call back and notify the clients that: (1) their client cached data is inconsistent with the data on the shared storage device, or (2) the client cached data must be written back to the server for updating the corresponding data residing on the shared storage device.
Using the server to maintain data consistency has several drawbacks. First, a server limits how fast data can be transferred across the network when it controls access to shared storage device. The speed at which data is obtained from the shared storage device is limited by the speed of the server. Second, a server-based architecture is susceptible to server failures. Such an architecture is not robust, because a server failure prevents all clients from accessing any of the storage devices controlled by the server. Third, maintaining a separate server for controlling access to shared storage devices adds additional complexity and expense to the system.
One aspect of the present system includes a data storage device that is accessible by first and second remote processing clients. The storage device includes at least one lock. Each lock is associated with the use of at least one storage block on the storage device by each of the first and second clients. The locks control access to the storage blocks based on control signals received from a distributed file system residing on both of the first and second clients. The clients acquire the locks for exclusive use by the acquiring client, or for shared use with other clients.
In various embodiments, the locks include: a version counter that is updated when data is written to the at least one storage block controlled by the lock, an activity element that triggers updating of the version counter for both reads and writes, an expiration timer for timing out the acquisition of the lock by the client, and a world-wide names list of clients that have acquired the lock. In various embodiments, the device locks execute actions based on control signals received from the clients. These actions are selected from the group consisting essentially of Lock, Unlock, Unlock Increment, Reset Lock, Activity On, Activity Off, Lock Shared, Lock Exclusive, Force Lock Exclusive, Touch Lock, and Report Expired actions.
Another aspect of the present system includes a method of using a system. The system has first and second processing clients, a distributed file system, a data storage device shared by the first and second clients, and a network coupled to the storage device and each of the first and second clients. The data storage device includes storage blocks and a plurality of locks. The method includes assigning a lock to at least one storage block using the file system. At least one of the storage blocks is accessed, using the first client, by acquiring the lock assigned to the at least one storage block, if the lock is available. The client acquires the lock for exclusive use by the acquiring client, or for shared use with other clients.
In various further embodiments, the method includes releasing the lock after accessing the storage block and updating a version counter associated with the lock if an activity element associated with the lock is set. Data is written from the first client to the storage block. A version counter associated with the lock is updated using the first client. The first client is used to release the lock.
In one embodiment, the method includes waiting for a predetermined period of time after setting the activity element by a second client. If the version counter associated with the lock is not updated during the predetermined period of time, then the version counter is updated and the lock is released by the second client. If the version counter is updated during the predetermined period of time, then the second client clears the activity element. In one embodiment, the second client provides an input version counter value to the storage device, and if a state of the lock""s version counter matches the input version counter value, then the second client updates the lock""s version counter and releases the identified lock.
The lock may be acquired for shared use with other clients, for exclusive use by the acquiring client. If the lock is exclusively held by the first client, it may subsequently be forcibly acquired using the second client. The method includes resetting or otherwise modifying an expiration timer associated with the lock, and obtaining the state of an expiration timer associated with the lock.
In summary, device locks provide decentralized control of the shared data storage device on which they are located. Clients acquire the locks for excluding other clients, thereby maintaining data consistency, or for shared use by multiple clients. The device locks allow use of a serverless distributed architecture global file system (GFS). A serverless system allows higher speed data transfer across the network, eliminates the risk of server failure, and reduces system cost and complexity. Shared data storage better utilizes storage resources and simplifies redundant storage techniques. Moreover, no communication between clients is required to arbitrate for the shared resources. Direct attachment of a shared storage device to a client is susceptible to the risk of that client""s failure; the present invention avoids this problem. A locally attached shared storage device also wastes a local host client""s bandwidth by using it to transfer data to other clients; this is also avoided by the present invention. Moreover, data file size is not limited by the storage capacity available on any particular host client. Also, the present invention minimizes overhead steps for data transfer. These and other aspects of the invention will be apparent after reading the following detailed description of the invention and accompanying drawings.